<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<!--
Copyright 2008 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <head>
    <title>Google Earth Plug-in</title>
    <!-- NOTE: replace the key below with your own key -->
    <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAwbkbZLyhsmTCWXbTcjbgbRSzHs7K5SvaUdm8ua-Xxy_-2dYwMxQMhnagaawTo7L1FE1-amhuQxIlXw"></script>
    <script type="text/javascript">
    google.load('earth', '1');

    var ge = null;
    
    function init() {
      google.earth.createInstance('map3d', initCallback, failureCallback);
    }

    function initCallback(pluginInstance) {
      ge = pluginInstance;
      ge.getWindow().setVisibility(true);
      
      // tell the application the plugin is ready
      window.external.JSInitSuccessCallback_(pluginInstance);
    }

    function failureCallback(error) {
      window.external.JSInitErrorCallback_(error);
    }
    
    function JSCreatePlacemarkAtCameraCenter(name) {
      var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
      
      var point = ge.createPoint('');
      point.setLatitude(lookAt.getLatitude());
      point.setLongitude(lookAt.getLongitude());
      
      var placemark = ge.createPlacemark('');
      placemark.setName(name);
      placemark.setDescription('I was called from Cocoa!');
      placemark.setGeometry(point);
      
      ge.getFeatures().appendChild(placemark);
    }
    </script>
    <style type="text/css">
    html, body {
      margin: 0;
      width: 100%;
      height: 100%;
    }
    </style>
  </head>
  <body onload="init()">
    <div id="map3d" style="width: 100%; height: 100%;"></div>
  </body>
</html>
